<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./../../Template/generalTemplate.xhtml">


            <ui:define name="content">
              <h:form>
               <f:view beforePhase="#{toQuotationManagedBean.initOne}">
                <p:panel header="Sales Quotation: Choose a Sales Inquiry" style="height:495px;">
                   <div style="margin-top:20px;margin-left:50px;margin-right:50px;">
                      <p:dataTable id="inquiry" value="#{toQuotationManagedBean.inquiryList}" var="inList" paginator="true" rows="6">

                                <p:column filterBy="#{inList.id}" filterMatchMode="contains"
                                          headerText="Inquiry ID">
                                    <h:outputText value="#{inList.id}"/>
                                </p:column>
                                <p:column filterBy="#{inList.company.name}" filterMatchMode="contains"
                                          headerText="Client">
                                    <h:outputText value="#{inList.company.name}"/>
                                </p:column>

                                <p:column filterBy="#{inList.company.salesman.name}" filterMatchMode="contains"
                                          headerText="Processed By">
                                    <h:outputText value="#{inList.company.salesman.name}"/>
                                </p:column>
                          
                                <p:column headerText="Action" style="text-align: center;width:90px;">
                                    <p:commandButton image="ui-icon ui-icon-search" title="View" action="#{toQuotationManagedBean.viewInquiry(inList)}" style="margin-right:10px;"/>
                                    <p:commandButton action ="#{toQuotationManagedBean.addInquiry(inList)}" image="ui-icon ui-icon-check" title="Select" />        
                                </p:column>  

                            </p:dataTable>  
                   </div> 
                </p:panel>
               </f:view>
              </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
